package worldinruin.gui.imp.gameview.gameboard;

import java.awt.Dimension;
import java.awt.Image;

import worldinruin.core.IBuilding;
import worldinruin.core.ITile;
import worldinruin.resources.Panels;
import worldinruin.utils.ResizableButton;

public class BuildingPiece extends ResizableButton implements ITilePiece{

	private IBuilding building;
	private Panels subPanelType = Panels.SELECTEDBUILDINGPANEL;
	private Panels mainPanelType = Panels.GAMEVIEWMAINPANEL;
	private Panels cardStack = Panels.GAMEVIEWLEFTCARDSTACK;

	/**
	 * Creates a building piece that is displayed on gameboard.
	 * @param img Image of piece.
	 * @param building Building to display.
	 */
	public BuildingPiece(Image img, IBuilding building) {
		super(img);
		this.building = building;
		setPreferredSize(new Dimension(50, 30));
		setBorderPainted(false);
	}

	@Override
	public IBuilding getPieceModel() {
		return building;
	}
	
	@Override
	public ITile getTileModel() {
		return building.getTile();
	}

	@Override
	public Panels getSubPanelType() {
		return subPanelType;
	}

	@Override
	public Panels getMainPanelType() {
		return mainPanelType;
	}

	@Override
	public Panels getCardStack() {
		return cardStack;
	}

}
